import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

public class three {
    public static void main(String[] args) throws IOException {
        File file = new File("E:" + File.separator + "text.txt");
        if (file == null) return;
        if (!file.exists()) file.createNewFile();

        FileOutputStream fileOutputStream = new FileOutputStream(file);
        String str = "hahahaha";
        fileOutputStream.write(str.getBytes());
        if (file.exists()) file.delete();
    }
}
